<%@page import="org.blackjuly.sign.service.ChartService"%>
<%@page import="org.blackjuly.sign.entity.Chart"%>
<%@page import="org.blackjuly.sign.service.GradeService"%>
<%@page import="java.sql.Connection"%>
<%@page import="org.blackjuly.sign.data.SystemDataSource"%>
<%@page language="java" pageEncoding="utf-8"%>
<%@include file="auth.jsp"%>
<%
ChartService chartService = new ChartService();
Connection conn = SystemDataSource.getInstance().getConnection();
chartService.setConnection(conn);
Chart chart = chartService.findGradeByStudent(userSession.getStudent());
int max[] = chartService.getMaxGrade(chart);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
<title>名次变化情况</title>
<style type="text/css">.w3cbbs { page-break-after:always;}
</style>
<script type="text/javascript" src="jQuery.js"></script>
<script type="text/javascript" src="jqplot.js"></script>
<script type="text/javascript">
	$(document).ready(
			function() {
				var data = [ [ <%=chart.getR1()%>, <%=chart.getR2()%>, <%=chart.getR3()%>,
				<%=chart.getR4()%>, <%=chart.getR5()%>, <%=chart.getR6()%>, <%=chart.getR7()%>,
				<%=chart.getR8()%>, <%=chart.getR9()%>, <%=chart.getR10()%>, <%=chart.getR11()%>,
				<%=chart.getR12()%>, <%=chart.getR13()%>, <%=chart.getR14()%>,<%=chart.getR15()%>,
				<%=chart.getR16()%>, <%=chart.getR17()%> ] ];
				var data_max = <%=max[0]+100%>; //Y轴最大刻度
				var line_title = [ "排名" ]; //曲线名称
				var y_label = "考试名次"; //Y轴标题
				var x_label = "考试项目"; //X轴标题
				var x = [ '七上第1次月考', '七上期中考试', '七上期末考试', '七下第1次月考', '七下期中考试',
						'七下期末考试', '八上第1次月考', '八上第2次月考', '八上期中考试', '八上期末考试',
						'八下入学考试', '八下第1次月考', '八下第2次月考', '八下期中考试', '八下期末考试', '九上第1次月考', "九上期中考试" ]; //定义X轴刻度值
				var title = "学生成绩波动情况"; //统计图标标题
				j.jqplot.diagram.base("chart1", data, line_title, "折线统计图", x,
						x_label, y_label, data_max, 1);
				j.jqplot.diagram.base("chart2", data, line_title, "条形统计图", x,
						x_label, y_label, data_max, 2);
			});
</script>
</head>
<body>
	<center><h1><%=chart.getName()%>成绩波动情况&nbsp;&nbsp;平均成绩：<%=max[1] %></h1></center>
	<div id="chart1"></div>
	<br />
	<div id="chart2"></div>
	<p class="w3cbbs"></p>
</body>
</html>